import java.util.Scanner;

/**
 * @author yexiebao
 * @date 2025/5/13
 */
public class IntervalSum {
    public static void main(String[] args){
        int sum = 0;
        Scanner scanner = new Scanner(System.in);
        int length = scanner.nextInt();
        int[] array = new int[length];
        for(int i = 0;i<length;i++){
            array[i] = scanner.nextInt();
        }
        int m =scanner.nextInt();
        int n = scanner.nextInt();
        for(int i = m;i<=n;i++){
            sum += array[i];
        }
        System.out.println(sum);
    }
}